package com.coustemview.qianfeng.huaqiangbeistore.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by mingma on 2016/8/29.
 */
public class mainpage_viewpager_adapter extends FragmentPagerAdapter {
    private List<Fragment>mFragments;
    private List<String>titles;
    public mainpage_viewpager_adapter(FragmentManager fm,List<Fragment>mFragments,List<String>titles) {
        super(fm);
        this.mFragments=mFragments;
        this.titles=titles;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments==null?0:mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return  titles.get(position);
    }
}
